package com.itcast.clientx.service;

import com.itcast.clientx.bean.Item;
import com.itcast.clientx.dao.ItemDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ItemService {

    @Autowired
    private ItemDao dao;
    public void save(Item item){
        dao.save(item);
    }
    public List<Item> find(Item item){
        Example<Item> example = Example.of(item);
        List<Item> list = dao.findAll(example);
        System.out.println("------");
        return list;
    }


}
